package leetcode;
//整数翻转
public class Reverse {
    public static void main(String[] args) {

        int reverse = reverse(-2147483648);
        System.out.println(reverse);
    }
    public static int reverse(int x) {
        long n = 0;
        while (x != 0){
            n = n * 10 + x % 10;
            x = x/10;
        }
        return (int) n == n ? (int) n:0;
    }
}
